package com.jumi.microservice.stock.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jumi.microservice.stock.domain.StockTransferDetailDO;
import com.jumi.microservice.stock.domain.StockTransferDetailDTO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description
 * @ClassName StockTransferDetailMapper
 * @Author Abel Yang
 * @Date 2020/9/11/011 15:18
 **/
public interface StockTransferDetailMapper extends BaseMapper<StockTransferDetailDO> {

    @Select("<script>" +
            "select d.id,d.material_id,d.material_code,d.transfer_id,d.transfer_num,m.bar_code,m.spec_name,m.weight" +
            " from jm_stock_transfer_detail as d join jm_material as m" +
            " on d.material_id=m.material_id" +
            " where d.is_del = 0 and d.transfer_id=#{transferId}" +
            "</script>")
    List<StockTransferDetailDTO> getDetailByTransferId(Long transferId);
}
